<template>
  <div class="loginView">
    <strong>登录界面</strong>
    <el-input v-model="account" placeholder="请输入账号" style="width: 300px" clearable />
    <el-input @keyup.enter="login(account, password)" v-model="password" type="password" placeholder="请输入密码" style="width: 300px" clearable />
    <div style="flex-direction: row;">
      <el-button @click="login(account, password)">登录</el-button>
      <el-button @click="toView('Register')">前往注册</el-button>
    </div>
  </div>
</template>

<script setup lang="ts">
import {login} from '@/views/LoginView/Hooks.ts';
import {toView} from '@/utils/utils';


const router = useRouter();
const route = useRoute();

const account: Ref<string> = ref(String(route.query.account || ''));
const password: Ref<string> = ref('');


</script>

<style scoped lang="less">
.loginView {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  strong {
    margin: 10px 0;
    font-size: 20px;
  }
}
</style>
